﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using XWG.JWBST.JWBSTBLL;
using XWG.JWBST.JWBSTEntity;
using System.Text;

namespace XWG.JWBST.JWBSTManagementApp.GAXX
{
    public partial class TbBstReturnForUser : System.Web.UI.Page
    {
        string appid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            appid = Request.QueryString["appid"].ToString();
            if (!string.IsNullOrEmpty(appid))
            {
                TbBstCaseReturn caseReturn = TbBstCaseReturnBLL.GetCaseReturn(appid);

                if (caseReturn != null)
                {
                    if (caseReturn.Casetype.ToString() == "01")
                    {
                        this.DivShowXS.Visible = true;
                        //刑事案件
                        this.LabXs.Text = "刑事案件信息";

                        this.labxsname.Text = caseReturn.FileName;
                        this.labxslasj.Text = caseReturn.FileDate;
                        this.labxsdw.Text = caseReturn.FileCompany;
                        this.labxsdh.Text = caseReturn.FileTel;
                        this.labxszbmj.Text = caseReturn.FilePolice;

                        if (!string.IsNullOrEmpty(caseReturn.BailDate))
                        {
                            this.spqbhs.Visible = true;
                            this.labxsqbhssj.Text = caseReturn.BailDate;
                        }
                        if (!string.IsNullOrEmpty(caseReturn.MonitorDate))
                        {
                            this.spjianshi.Visible = true;
                            this.labxsjssj.Text = caseReturn.MonitorDate;
                        }
                        if (!string.IsNullOrEmpty(caseReturn.DetentionPlace) && !string.IsNullOrEmpty(caseReturn.DetentionDate))
                        {
                            this.spjuliu.Visible = true;
                            this.labxsjld.Text = caseReturn.DetentionPlace;
                            this.labxsjlsj.Text = caseReturn.DetentionDate;
                        }
                        if (!string.IsNullOrEmpty(caseReturn.ArrestDate) && !string.IsNullOrEmpty(caseReturn.ArrestPlace))
                        {
                            this.spdaibu.Visible = true;
                              this.labxsjyd.Text = caseReturn.ArrestPlace;
                            this.labxsdbsj.Text = caseReturn.ArrestDate;
                        }
                        if (!string.IsNullOrEmpty(caseReturn.SueDate) && !string.IsNullOrEmpty(caseReturn.SueProcuratorate))
                        {
                            this.spqisu.Visible = true;
                            this.labxsyssj.Text = caseReturn.SueDate;
                            this.labxsqsjcy.Text = caseReturn.SueProcuratorate;
                        }

                    }
                    else if (caseReturn.Casetype.ToString() == "02")
                    {
                        this.DivShowXZ.Visible = true;
                        this.LabXz.Text = "行政案件信息";
                        this.labxzname.Text = caseReturn.AdAcceptName;
                        this.labxsslrq.Text = caseReturn.AdAcceptDate;
                        this.labxzbldw.Text = caseReturn.AdAcceptCompany;
                        this.labxzdh.Text = caseReturn.AdAcceptTel;
                        this.labxzmj.Text = caseReturn.AdAcceptPolice;
                        this.labxzjg.Text = caseReturn.AdPenaltyResult;
                        //行政案件
                    }
                    else
                    {
                        this.DivShowBYLA.Visible = true;
                        //不予立案
                        this.LabByla.Text = "不予立案信息";
                        this.labbylaname.Text = caseReturn.NotfiledName;
                        this.labbylasj.Text = caseReturn.NotfiledDate;
                        this.labbyladw.Text = caseReturn.NotfiledCompany;
                        this.labbyladh.Text = caseReturn.NotfiledTel;
                        this.labbylamj.Text = caseReturn.NotfiledPolice;
                    }
                }
                else
                {
                    this.DivShowull.Visible = true;
                    Response.Write("<script type='text/javascript'>setTimeout('CallForData()', 10000);</script>");
                    //Page.RegisterStartupScript("提示", "<script language=javascript>alert(\"您好，数据正在处理中，请耐心等待...\");</script>");
                    //Page.RegisterStartupScript("提示", "<script language=javascript>setTimeout(CallForData, 3000);</script>");
                }

            }
            else
            {
                Page.RegisterStartupScript("提示", "<script language=javascript>alert(\"请求错误\")</script>");
            }
        }
    }
}